const isDev = true

const ua = navigator.userAgent
export const isWechat = /micromessenger/i.test(ua)
export const isIOS = /iphone|ipod|ipad/i.test(ua)

export const baseURL = isDev ? 'http://39.100.124.184:13080/video-api-webapp/api/' : 'https://api.haojiabangmang.cn/api/app'

const env = {
  isApp: /ptys/i.test(ua),
  isMobile: /android|iphone|ipod|ipad/i.test(ua),
  isIOS: /iphone|ipod|ipad/i.test(ua),
  isAndroid: /android/i.test(ua),
  isWechat: /micromessenger/i.test(ua),
  isQQ: /qq\//i.test(ua),
  isWeibo: /weibo/i.test(ua),
  isDingTalk: /dingtalk/i.test(ua)
}
env.isBrowser = !(env.isApp) || env.isWechat || env.isQQ || env.isWeibo || env.isDingTalk

export default {
  isIOS,
  isWechat,
  baseURL,
  isDev,
  env
}
